#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int countGoodStrings(int low, int high, int zero, int one) {
        vector<int> dp(high + 1);
        int res = 0;
        const int MOD = 1e9 + 7;
        dp[0] = 1;
        for (int i = 0; i <= high; i++)
        {
            if (i >= zero) dp[i] += dp[i - zero];
            if (i >= one) dp[i] += dp[i - one];
            dp[i] %= MOD;
            if (i >= low) res += dp[i];
            res %= MOD;
        }
        return res;
    }
};